import request from '@/config/axios'

// 故障监测 VO
export interface RobotFaultMonitorVO {
  id: number // 主键
  heathCode: string // 序号
  robotId: number // 机器人id
  robotType: string // 机器人类型
  robotCode: string // 机器人编号
  robotName: string // 机器人名称
  customer: string // 客户
  faultRemark: string // 故障描述
  area: string // 地区
  severity: string // 故障严重程度 1轻微、2一般、3严重
  handleStatus: number // 处理状态 0未处理、1处理中、 2已处理
  findTime: Date // 检测时间
}

// 故障监测 API
export const RobotFaultMonitorApi = {
  // 查询故障监测分页
  getRobotFaultMonitorPage: async (params: any) => {
    return await request.get({ url: `/health/robot-fault-monitor/page`, params })
  },

  // 查询故障监测详情
  getRobotFaultMonitor: async (id: number) => {
    return await request.get({ url: `/health/robot-fault-monitor/get?id=` + id })
  },

  // 新增故障监测
  createRobotFaultMonitor: async (data: RobotFaultMonitorVO) => {
    return await request.post({ url: `/health/robot-fault-monitor/create`, data })
  },

  // 修改故障监测
  updateRobotFaultMonitor: async (data: RobotFaultMonitorVO) => {
    return await request.put({ url: `/health/robot-fault-monitor/update`, data })
  },

  // 删除故障监测
  deleteRobotFaultMonitor: async (id: number) => {
    return await request.delete({ url: `/health/robot-fault-monitor/delete?id=` + id })
  },

  // 导出故障监测 Excel
  exportRobotFaultMonitor: async (params) => {
    return await request.download({ url: `/health/robot-fault-monitor/export-excel`, params })
  },
}